<!-- saved from url=(0026)/test.html -->
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">

    <title>马蜂窝问答,解决旅行问题,基于旅游的问答分享平台 - 马蜂窝</title>
    <meta name="viewport"
          content="width=device-width,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no,minimal-ui,viewport-fit=cover">
    <meta name="format-detection" content="telephone=no,address=no">

    <link href="/css/mobile+css+head-mobile+css+ui-mobile+css+ui+slider.default%5EZl0%5E1526627473.css" rel="stylesheet" type="text/css">

    <link href="/css/ask.css" rel="stylesheet" type="text/css">

    <script src="/js/plugins/jquery/jquery.min.js"></script>
    <script src="/js/plugins/form/jquery.form.js"></script>
    <script src="/js/plugins/jrender/jrender.min.js"></script>
    <link rel="stylesheet" href="/js/plugins/dialog2/dialog.css"/>
    <script src="/js/plugins/dialog2/dialog.min.js"></script>
    <!-- 插件核心 -->
    <script src="/js/plugins/eleditor/Eleditor.min.js"></script>
    <!-- 如果需要图片上传 -->
    <script src="/js/plugins/eleditor/webuploader.min.js"></script>
    <script src="/js/common.js"></script>
    <script>
        $(function () {
            var qid;

            // 获取问题id
            var params = getParams()
            if (params.id) {
                // 获取问题
                $.get("/questions/" + params.id, function (data) {
                    $(".Addnew").renderValues(data)
                    qid = params.id;
                });
            }

            // eleditor
            var Edr = new Eleditor({
                el: '#elcontainer',
                upload:{
                    server: '/images'
                }
            });

            // 提交回答
            $("#answer_form").ajaxForm(function (data) {
                if (data.success) {
                    $(document).dialog({
                        type : 'alert',
                        style: 'android',  // default、ios、android
                        titleText: '谢谢!',
                        content: '回答提交成功!',
                    });
                    window.location.href = "/answer.html?id=" + qid;
                }
            })

            // 提交按钮点击事件
            $("._j_publish_answer").click(function () {
                $("#content").html(Edr.getContent())
                $("#answer_form").submit();
            });
        });
    </script>
</head>
<body >
<div id="pos38"></div>
<div class="wrapper">
    <header class="MfwHead ">
        <div class="LBtn"><a class="btn back" href="javascript:void(window.history.length &gt; 1 ? window.history.back() : document.location.href= '/index.html')"
                             id="_j_top_history_back"></a>
        </div>
        <div class="CBtn"><h1>骡窝窝问答</h1></div>
        <div class="RBtn">
        </div>
    </header>

    <section class="container">
        <section data-cs-t="wenda">
            <!--Addnew-->
            <section class="Addnew">
                <!--问题标题-->
                <div class="replycon" render-html="title">
                </div>
                <dl>
                    <form id="answer_form" action="/answers/save" method="post">
                        <input type="hidden" name="question.id" render-value="id">
                        <input type="hidden" name="s" value="publish_answer">
                        <dd class="con_textarea" id="con_textarea" >
                            <div id="elcontainer"></div>
                        </dd>
                        <textarea id="content" name="content" style="display: none"></textarea>
                    </form>
                </dl>
                <dl>
                    <dd>
                        <a href="#" class="_j_publish_answer">回答</a>
                    </dd>
                </dl>
            </section>
            <!--AddnewEnd-->
        </section>
    </section>
</div>
</body>
</html>